#ifndef __GENEEGDATA_H__
#define __GENEEGDATA_H__

#include <iostream>
#include <vector>
#include <array>
#include <QString>

#define MAX_CHANNALNUM 64   // 最大支持64导
#define TRAIN_VIDEO_NUM 3   // 每个种类的视频数量
#define TEST_VIDEO_NUM 1   // 每个种类的视频数量


typedef std::array<double, MAX_CHANNALNUM> EEGDataArr;


typedef struct _FileHeadStr
{
    _FileHeadStr(){
        channalNum = 0;
    };

    long long channalNum;
    // 剩余7字节空白
    // sizeof(long long)  = sizeof(long) = 8
    // long long empty:56;
    
    long long neg_lable_beginIndex[TRAIN_VIDEO_NUM] = {0};
    long long neg_lable_endIndex[TRAIN_VIDEO_NUM] = {0};
    long long neu_lable_beginIndex[TRAIN_VIDEO_NUM] = {0};
    long long neu_lable_endIndex[TRAIN_VIDEO_NUM] = {0};
    long long pos_lable_beginIndex[TRAIN_VIDEO_NUM] = {0};
    long long pos_lable_endIndex[TRAIN_VIDEO_NUM] = {0};

    long long neg_lable_beginIndex_test[TEST_VIDEO_NUM] = {0};
    long long neg_lable_endIndex_test[TEST_VIDEO_NUM] = {0};
    long long neu_lable_beginIndex_test[TEST_VIDEO_NUM] = {0};
    long long neu_lable_endIndex_test[TEST_VIDEO_NUM] = {0};
    long long pos_lable_beginIndex_test[TEST_VIDEO_NUM] = {0};
    long long pos_lable_endIndex_test[TEST_VIDEO_NUM] = {0};


}FileHeadStr;

class GenEEGData
{  
public:
    GenEEGData(uint8_t channalNum = MAX_CHANNALNUM);
    ~GenEEGData();
    void clear();
    
    void print(QString log = QString());

    int saveData(const char* filePath, bool saveHead_flag);
    bool loadData(const char* filePath);



public:
    /* data */
    // 通道名称ID，对应使用不同编号顺序的电极帽
    // uint8_t ChannalID;
    // 通道数
    FileHeadStr dataHead;
    // 每一个通道的数据
    // double data[MAX_CHANNALNUM];
    std::vector<EEGDataArr> data;

};


#endif // __GENEEGDATA_H__


